public class sampleCon {

    public PageReference test3() {
    if(selectitems.size()>0)
    {
     if(hjk!= '')
     {
      hjk = '';
     }
     hjk = 'name';
     for(SelectOption sp : selectitems)
                {
                  
                       hjk += ','+ sp.getvalue();
                  
                }
                
     }
        return null;
    }


    public String hjk { get; set; }
     public String getHjk()
    {
        return hjk ;
    }
    public String fgh { get; set; }
     public String getFgh()
    {
        return fgh ;
    }
    public String sdf { get; set; }
    public String getSdf()
    {
        return sdf ;
    }
    public sampleCon()
    {
        selectitems = new List<SelectOption>();
        citems = new List<SelectOption>();
        
        //if()
        //{
            
        //}
       /* string str = 'id,name';
        string[] strarr = str.split(',');
        for(string s : strarr)
        {
            selectitems.add(new SelectOption(s,s));
                                                
                Integer ind = 0;
                for(SelectOption sp : citems)
                {
                    if(sp.getvalue() != s)
                    {
                        ind++;
                    }
                    else
                    {
                        break;
                    }
                    citems.remove(ind);
                }
        }*/
        
    }
    public List<SelectOption> selectitems{get;set;}
    public List<SelectOption> getSelectcitems() {
        return selectitems;
    }


    public String[] selectcitys { get; set; }
      public String[] getSelectcitys() {
        return selectcitys ;
    }

       public void setSelectcitys(String[] selectcitys ) {
            this.selectcitys = selectcitys ;
        }

    public PageReference test2() {
         if(selectcitys .size()>0)
        {     
            for(string s : selectcitys )
            {                          
                Integer ind = 0;
                for(SelectOption sp : selectitems)
                {
                    if(sp.getvalue() != s)
                    {
                        ind++;
                    }
                    else
                    {
                        break;
                    }
                }
                citems.add(new SelectOption(s,s));
                //for(selectoption sp : selectitems)
                //{
                     selectitems.remove(ind );
                //}
               
                
                //selectcitys.add(s);
            }
        }
        return null;
    }

    public PageReference test1() {
    
        if(citys.size()>0)
        {     
            for(string s : citys)
            {                          
                Integer ind = 0;
                for(SelectOption sp : citems)
                {
                    if(sp.getvalue() != s)
                    {
                        ind++;
                    }
                    else
                    {
                        break;
                    }
                }
                selectitems.add(new SelectOption(s,s));
                //for(selectoption sp : selectitems)
                //{
                     citems.remove(ind );
                //}
               
                
                //selectcitys.add(s);
            }
        }
        return null;
    }

    public string[] citys{get;set;}
    public List<SelectOption> citems{get;set;}
    public List<SelectOption> getCitems() {       
             
           
         return citems;
    }

        public String[] getCitys() {
        return citys;
    }

       public void setCitys(String[] citys) {
            this.citys= citys;
        }

        String[] countries = new String[]{};
            
        public PageReference test() {
        citems.clear();
        selectitems.clear();
            Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
            if(countries.size()>0)
            {
            Schema.DescribeSObjectResult objD = gd.get(countries[0]).getDescribe();
             String keyPrefix = (String)objD .getKeyPrefix();
             sdf  = keyPrefix ;
             fgh  = (String)countries[0];
           Map<String, Schema.SobjectField> fields =
           objD.fields.getMap();
                for (String s : fields.keySet()) {
                if(s!='name')
                {
                       citems.add(new SelectOption(s,s));  
                 }
               }     
           } 
            return null;
        }
            
        public List<SelectOption> getItems() {
            List<SelectOption> options = new List<SelectOption>();
              Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
            for(String obj : gd.keySet()) {
               options.add(new SelectOption(obj ,obj ));            }
        return options;
        }
            
        public String[] getCountries() {
            return countries;
        }
            
        public void setCountries(String[] countries) {
            this.countries = countries;
        }
    }